# !/usr/bin/env python
# -*- coding: utf-8 -*-
# @File  : 特征预处理（标准化）.py
# @Author: dongguangwen
# @Date  : 2025-01-19 15:02
# 1.导入工具包
from sklearn.preprocessing import StandardScaler

# 2.数据(只有特征)
x = [[90, 2, 10, 40], [60, 4, 15, 45], [75, 3, 13, 46]]

# 3.实例化(标准化)
process = StandardScaler()

# 4.fit_transform 处理
data = process.fit_transform(x)

print(data)

print(f'均值：{process.mean_}')
print(f'标准差：{process.var_}')

"""
[[ 1.22474487 -1.22474487 -1.29777137 -1.3970014 ]
 [-1.22474487  1.22474487  1.13554995  0.50800051]
 [ 0.          0.          0.16222142  0.88900089]]
均值：[75.          3.         12.66666667 43.66666667]
标准差：[150.           0.66666667   4.22222222   6.88888889]
"""
